import { userStore } from '@/stores'
import { appConfig } from '@/config/index.js'

export const usePermission = (code: any) => {
  if (appConfig.asyncRoutes == true && code) {
    const userInfoStore = userStore()
    const permissions = userInfoStore.permissons
    return permissions.includes(code)
  }
  return true
}
